<?php
$origin = isset($_SERVER['HTTP_ORIGIN'])? $_SERVER['HTTP_ORIGIN'] : '';
$allow_origin = array(
    'http://www.hongyanche.com',
    'http://m.hongyanche.com',
    'http://admin.hongyanche.com',
    'http://localhost:8080',
);
header('Access-Control-Allow-Credentials : true');
if(\think\Request::instance()->isOptions()){
    if(in_array($origin, $allow_origin)){

        header('Access-Control-Allow-Origin:'.$origin);
    }
    header('Access-Control-Allow-Methods: POST, GET, OPTIONS,PUT');
    header('Access-Control-Allow-Headers: Origin,X-Requested-With, Content-Type, Accept');
    header('Access-Control-Max-Age: 172800');//20天
    header("Content-Length: 0");
    header("Content-Type: text/plain");
    exit(0);
}
if(in_array($origin, $allow_origin)){
    header('Access-Control-Allow-Origin:'.$origin);
}
return [
    'name' => 'hongyanche',
    //hongyanchesms
    'sms' => [
        'channel'	=> 'sih',
    ],
    'email' => [
        'channel'		=> 'sih',
        'name'			=> '红岩车',
    ],
    'wechat' => [
        'APPNAME'		=> 'hongyanche',	//用于寻找配置文件access_token.json jsapi文件
        //tiesh.com
        'APPID'     => 'wxbcaea9c853066c75',
        'APPSECRET' => 'c1b9e5a7012edb4c0093f07ea192a227',
        'APP_INDEX' => 1,
        'WX_MCHID'	=> '1241558002',
        'WX_PAYKEY'	=> '167f894bc92561d5449c332d9059cddb',
        'CERT_PATH' => '/hongyanche.com/online/application/hongyanche/apiclient_cert.pem',
        'KEY_PATH'  => '/hongyanche.com/online/application/hongyanche/apiclient_key.pem',
        'NOTIFY_URL'=> 'http://www.hongyanche.com/pay/receive_tenpay',
        // 'WX_MCHID'	=>'',
        // 'WX_PAYKEY'	=>'',

        'xcx' => [
            // 'APPID' 	=> '',
            // 'APPSECRET' => '',
            // 'APP_INDEX' => ,
        ]
    ],

    'alipay' => [
        'app_id' 				=> "",
        'alipay_public_key' 	=> "",
        'merchant_private_key' => "",
        'notify_url'			=> '',
    ],

    'url' 	=> 'http://www.hongyanche.com/',

    'session'                => [
        'id'             => '',
        // SESSION_ID的提交变量,解决flash上传跨域
        'var_session_id' => '',
        // SESSION 前缀
        'prefix'         => 'hyc',
        // 驱动方式 支持redis memcache memcached
        'type'           => '',
        // 是否自动开启 SESSION
        'auto_start'     => true,
        'domain'         => ".hongyanche.com",
    ]
];